home *** CD-ROM | disk | FTP | other *** search
/ Palm Utilities / Palm_Utilities_CD-ROM_2001_2001.iso / files / calc misc / RPN PopUp Calculator 1.0.1 / rpnpopcalc.exe / Scripts.txt < prev   
Encoding:
Text File  |  1999-04-15  |  1.9 KB  |  114 lines

  1. To use scripts bellow, copy each script to a separate
  2. MemoPad record in the "RpnPopCalc" category using Palm
  3. Desktop application, and then just do a HotSync.
  4.  
  5. -----------------
  6. Script example 1:
  7. This script calculates box volume.
  8. -----------------
  9. #Box volume
  10. ?Box length:
  11. ?Box width:
  12. ?Box height:
  13. * *
  14. !Box volume is:
  15.  
  16. -----------------
  17. Script example 2:
  18. This script compares all numbers on the stack and returns the largest number.
  19. -----------------
  20. #Max
  21. :1
  22. DEPTH
  23. 1 >
  24. @2
  25. END
  26. :2
  27. DUP
  28. 3 ROLL
  29. DUP
  30. 3 ROLL
  31. <
  32. @3
  33. SWAP
  34. :3
  35. DROP
  36. #An example for unconditional jump
  37. #Just put a non-zero number on the stack and invoke a jump
  38. 1
  39. @1
  40.  
  41. -----------------
  42. Script example 3:
  43. This function calculates the factorial of a number. Because RPN PopUp
  44. Calculator interprets the script, it can be quite slow. One of our plans
  45. for the future is to make a special script editor/compiler, so scripts will
  46. be executed much faster.
  47. -----------------
  48. #Factorial
  49. ?Number:
  50. INT DUP 2 >=
  51. @1
  52. DROP 1 1
  53. @3
  54. :1
  55. DUP
  56. :4
  57. 1 -
  58. DUP
  59. 2 <
  60. @2
  61. DUP
  62. 3 ROLL * SWAP
  63. 1 @4
  64. :2
  65. DROP
  66. :3
  67. !The result is:
  68.  
  69. ----------------
  70. Script example 4:
  71. This script calculates monthly payment given present value, annual interest
  72. rate, number of payment periods, future value and payment type (0 - payments
  73. are due at the end of the period, 1 - payments are due at the beginning of
  74. the period. This function works exactly like MS Excel PMT() function.
  75. ----------------
  76.  
  77. #PMT (Payment)
  78. ?Present value:
  79. 0 STO DROP
  80. ?Future value:
  81. 1 STO DROP
  82. ?Annual interest rate (%):
  83. 1200 / 2 STO DROP
  84. ?Number of payment periods:
  85. 3 STO DROP
  86. ?Payment type (0/1):
  87. #0=at the end of period
  88. #1=at the beginning of period
  89. 4 STO DROP
  90. 2 RCL
  91. 0 =
  92. @1
  93. 1
  94. 2 RCL +
  95. 3 RCL POW
  96. 5 STO
  97. 0 RCL * 1 RCL +
  98. 1 2 RCL 4 RCL * +
  99. 5 RCL 1 -
  100. 2 RCL /
  101. *
  102. 1
  103. @2
  104. :1
  105. 0 RCL
  106. 1 RCL
  107. +
  108. 3 RCL
  109. :2
  110.  /
  111. 2 ROUND
  112. CHS
  113. !Monthly payment is:
  114.